import logging

import requests

from config import BASE_URL


class IHRMLoginApi:
    @classmethod
    def login(cls, login_data) -> requests.Response:
        url = BASE_URL + '/api/sys/login'
        header = {"Content-Type": "application/json"}

        # 打印 数据日志文件
        logging.info(f"请求的数据：{login_data}")
        r = requests.post(url, headers=header, json=login_data)

        return r
